<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>山东理工大学教学设施管理系统</title>
        <link href="http://qrserver.qiniudn.com/2.3.0-bootstrap-combined.min.css" rel="stylesheet">
        <script src="http://qrserver.qiniudn.com/1.10.2-jquery.min.js"></script>
        <script src="http://qrserver.qiniudn.com/3.0.3-bootstrap.min.js"></script>
    </head>

    <body>
        <div class="container-fluid">
            <div class="navbar navbar-inverse">
                <div class="navbar-inner">
                    <a class="btn btn-navbar" data-target=".navbar-responsive-collapse" data-toggle="collapse"> </a> 
                    <a class="brand" href="{% url 'index' %}">SDUT Devices</a>
                    <div class="nav-collapse collapse navbar-responsive-collapse">
                        <ul class="nav" >
                            <li><a href="{% url 'index' %}">主页</a></li>
                            <li  class="active"><a href="{% url 'devices:search' %}">设备查询</a></li>
                            <li><a href="{% url 'maintain:search' %}">维修记录</a></li>
                            <li><a href="{% url 'devices:QRcode' %}">获取二维码</a></li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="row-fluid">
                <div class="span8">
                    <div class="hero-unit" style="height: 100px">
                        <form method="post" accept-charset="utf-8">
                            <div class="control-group" style="float:left; margin-right:20px;">
                                <label class="control-label" for="inputNum">资产编号：</label>
                                <input id="inputNum" type="text" name="num"/>
                            </div>
                            <div class="control-group" style="float:left; margin-right:20px;">
                                <label class="control-label" for="inputName">名 称：</label>
                                <input id="inputName" type="text" name="name"/>
                            </div>
                            <div class="control-group">
                                <label class="control-label">购买时间(精确到月份)：</label>
                                <select name="selYear" style="width:90px;">
                                    <option value="">———</option>
                                    {% for i in year %}
                                        <option value="{{ i }}">{{ i }}年</option>
                                    {% endfor %}
                                </select>
                                <select name="selMonth" style="width:90px;">
                                    <option value="">———</option>
                                    {% for i in month %}
                                        <option value="{{ i }}">{{ i }}月</option>
                                    {% endfor %}
                                </select>
                            </div>
                            <div class="control-group" style="float:left; margin-right:20px;">
                                <label class="control-label" for="inputPlace">存放地点：</label>
                                <input id="inputPlace" type="text" name="location"/>
                            </div>
                            <div class="control-group" style="float:left; margin-right:20px;">
                                <label class="control-label" for="inputMan">使(领)用人：</label>
                                <input id="inputMan" type="text" name="man"/>
                            </div>
                            <div class="control-group">
                                <div class="controls">
                                    <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <button type="submit" class="btn btn-large btn-primary" style="height:37px;"><strong>搜索</strong></button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="span4">
                    <div class="alert">
                        <button type="button" class="close" data-dismiss="alert">×</button>
                        <h4>提示:</h4>
                        {{ message }}
                    </div>
                </div>
            </div>
            <br />
            <div class="row-fluid">
                <div class="span12">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>编 号</th>
                                <th>名 称</th>
                                <th>型 号</th>
                                <th>规 格</th>
                                <th>计量单位</th>
                                <th>存放地点</th>
                                <th>使(领)用人</th>
                                <th>现状</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for device in result %}
                                <tr
                                    {% if forloop.counter|divisibleby:"4" %}
                                        class="info"
                                    {% elif forloop.counter|divisibleby:"3" %}
                                        class="warning"
                                    {% elif forloop.counter|divisibleby:"2" %}
                                        class="error"
                                    {% elif forloop.counter|divisibleby:"1" %}
                                        class="success"
                                    {% endif %}
                                    >
                                    {% for item in device %}
                                        <td>{{ item }}</td>
                                    {% endfor %}
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <div class="pagination">
                        <ul>
                            <li><a href="#">上一页</a></li>
                            <li><a href="#">1</a></li>
                            <li><a href="#">下一页</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

    </body>
</html>
